home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 15: Shareware / PC Actual CDT 15.iso / files / Windows_95_98 / Programacion / ActiveX / NCTWavPlayer.exe / Main / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-06  |  2.3 KB  |  109 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "TestVC.h"
  6.  
  7. #include "MainFrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMainFrame
  17.  
  18. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  19.  
  20. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  21.     //{{AFX_MSG_MAP(CMainFrame)
  22.     ON_WM_CREATE()
  23.     //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25.  
  26. static UINT indicators[] =
  27. {
  28.     ID_INDICATOR_I1,
  29.     ID_INDICATOR_I2,
  30.     ID_INDICATOR_I3,
  31.     ID_INDICATOR_I4,
  32.     ID_INDICATOR_I5,
  33. };
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CMainFrame construction/destruction
  37.  
  38. CMainFrame::CMainFrame()
  39. {
  40.     // TODO: add member initialization code here
  41.     
  42. }
  43.  
  44. CMainFrame::~CMainFrame()
  45. {
  46. }
  47.  
  48. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  49. {
  50.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  51.         return -1;
  52.     
  53.     if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  54.         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  55.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  56.     {
  57.         TRACE0("Failed to create toolbar\n");
  58.         return -1;      // fail to create
  59.     }
  60.  
  61.     if (!m_wndStatusBar.Create(this) ||
  62.         !m_wndStatusBar.SetIndicators(indicators,
  63.           sizeof(indicators)/sizeof(UINT)))
  64.     {
  65.         TRACE0("Failed to create status bar\n");
  66.         return -1;      // fail to create
  67.     }
  68.  
  69.  
  70.     // TODO: Delete these three lines if you don't want the toolbar to
  71.     //  be dockable
  72.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  73.     EnableDocking(CBRS_ALIGN_ANY);
  74.     DockControlBar(&m_wndToolBar);
  75.  
  76.     return 0;
  77. }
  78.  
  79. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  80. {
  81.     if( !CFrameWnd::PreCreateWindow(cs) )
  82.         return FALSE;
  83.     // TODO: Modify the Window class or styles here by modifying
  84.     //  the CREATESTRUCT cs
  85.  
  86.     return TRUE;
  87. }
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CMainFrame diagnostics
  91.  
  92. #ifdef _DEBUG
  93. void CMainFrame::AssertValid() const
  94. {
  95.     CFrameWnd::AssertValid();
  96. }
  97.  
  98. void CMainFrame::Dump(CDumpContext& dc) const
  99. {
  100.     CFrameWnd::Dump(dc);
  101. }
  102.  
  103. #endif //_DEBUG
  104.  
  105. /////////////////////////////////////////////////////////////////////////////
  106. // CMainFrame message handlers
  107.  
  108.  
  109.